﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Security.Permissions;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace SCS.Web.UI.WebControls
{
    /// <summary>
    /// Event delegate for <see cref="HierList.ItemClicked"/> and <see cref="HierList.ItemDataBound"/>.
    /// </summary>
    /// <param name="sender">The sending object.</param>
    /// <param name="e">The event arguments.</param>
    public delegate void HierItemClickedHandler(object sender, HierItemEventArgs e);

    /// <summary>
    /// Represents event arguments for <see cref="HierList.ItemClicked"/> and <see cref="HierList.ItemDataBound"/>.
    /// </summary>    
    public class HierItemEventArgs : CommandEventArgs
    {
        //HierListItem _sourceItem;

        /// <summary>
        /// Initializes a new instance of the <see cref="HierItemEventArgs"/> class.
        /// </summary>
        /// <param name="sourceItem">The source item.</param>
        public HierItemEventArgs(HierListItem sourceItem) : base("", sourceItem.Value)
        {
            SourceItem = sourceItem;
        }

        /// <summary>
        /// Gets or sets the source list item.
        /// </summary>
        /// <value>The source list item.</value>
        public HierListItem SourceItem
        {
            get;
            private set;
        }

        /// <summary>
        /// Gets or sets a value indicating whether this <see cref="HierItemEventArgs"/> is cancel.
        /// </summary>
        /// <value><c>true</c> if cancel; otherwise, <c>false</c>.</value>
        public bool Cancel
        {
            get;
            set;
        }
    }
}
